package com.oauth.twitter.server.global;

import org.springframework.beans.factory.annotation.Required;

import com.oauth.service.application.global.ApplicationGlobalServiceAdapter;
import com.oauth.twitter.server.service.TwitterOAuthService;

public class TwitterGlobalService extends ApplicationGlobalServiceAdapter {

	private TwitterOAuthService mTwitterOAuthService;

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.oauth.service.application.global.ApplicationGlobalServiceAdapter#
	 * updateStatus(java.lang.Long, java.lang.String)
	 */
	@Override
	public boolean updateStatus(Long pMemberId, String pStatusText) {
		// TODO Auto-generated method stub
		// mOrkutOAuthService.
		try {
			mTwitterOAuthService.updateTweet(pStatusText, pMemberId);
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
		return true;
	}

	/**
	 * @return the twitterOAuthService
	 */
	public TwitterOAuthService getTwitterOAuthService() {
		return mTwitterOAuthService;
	}

	/**
	 * @param pTwitterOAuthService
	 *            the twitterOAuthService to set
	 */
	@Required
	public void setTwitterOAuthService(TwitterOAuthService pTwitterOAuthService) {
		mTwitterOAuthService = pTwitterOAuthService;
	}

}
